#对比算法，假设相邻相似
a = [1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,5,5,5,5,5,6,6,6,6,6]

flag1 = 0
flag2 = 0

for i in range(len(a)):
    flag1 = a[i]
    if flag2 == flag1:
        continue
    else:
        print(i,a[i])
        flag2 = flag1

